package com.example.aop;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class ServiceAspect {
	
//	 @Pointcut("execution(* com.example.demo.dao..*.*(..))" +
//			 "||execution(* com.example.demo.controller..*.*(..))" +
//			 "||execution(* com.example.demo.mapper..*.*(..))")
	 @Pointcut("execution(* com.example.service..*.*(..)))")
	 public void log(){}
	 
	 @Before("log()")
	 public void doBefore(JoinPoint  joinPoint ){
		 
		 String typeName = joinPoint.getSignature().getDeclaringTypeName();
		 System.out.println("##############TypeName:" + typeName);
	 }

}
